import Vue from 'vue'
import Vuex from 'vuex'
import { getCarData } from "../api/index"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    carData: []
  },
  mutations: {
    SET_CARDATA(state, data) {
      state.carData = data
    }
  },
  actions: {
    getdata(context, data) {
      getCarData().then((resp: any) => {
        context.commit("SET_CARDATA", resp.data.data)
      })
    }
  },
  modules: {
  }
})
